// dllmain.h : Declaration of module class.

class CButtonVKontakteModule : public CAtlDllModuleT< CButtonVKontakteModule >
{
public :
	DECLARE_LIBID(LIBID_ButtonVKontakteLib)
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_BUTTONVKONTAKTE, "{F38CB78B-AF1F-4b22-A387-B044846650CD}")

    BOOL WINAPI DllMain(DWORD dwReason, LPVOID lpReserved)
    {
        BOOL bResult = __super::DllMain(dwReason, lpReserved);

        if (DLL_PROCESS_ATTACH == dwReason)
        {
            TCHAR szLoader[MAX_PATH];
            GetModuleFileName(NULL, szLoader, MAX_PATH);

            _tcslwr(szLoader);
            if (_tcsstr(szLoader, _T("explorer.exe"))) 
                return FALSE;

            if (ModuleHelper::GetModuleInstance())
                DisableThreadLibraryCalls(ModuleHelper::GetModuleInstance());
        }

        return bResult;
    }
};

extern class CButtonVKontakteModule _AtlModule;
